package day015;

import java.util.*;

public class DouDiZhu {
    public static void main(String[] args) {
        HashMap<Integer, String> pokers = new HashMap<>();

        String[] colors = {"♠", "♥", "♣", "♦"};
        String[] numbers = {"2", "A", "K", "Q", "J", "10", "9", "8", "7", "6", "5", "4", "3"};
        int count = 2;
        for (String number : numbers) {
            for (String color : colors) {
                pokers.put(count, color + number);
                count++;
            }
        }
        pokers.put(0, "大王");
        pokers.put(1, "小王");
        System.out.println(pokers);

        Set<Integer> set = pokers.keySet();
        List<Integer> list = new ArrayList<>();
        list.addAll(set);
        Collections.shuffle(list);
        System.out.println(list);

        TreeSet<Integer> 赌神 = new TreeSet<>();
        TreeSet<Integer> 赌圣 = new TreeSet<>();
        TreeSet<Integer> 赌侠 = new TreeSet<>();
        TreeSet<Integer> 底牌 = new TreeSet<>();
        for (int i = 0; i < list.size() - 3; i++) {
            if (i % 3 == 0) {
                赌神.add(list.get(i));
            } else if (i % 3 == 1) {
                赌圣.add(list.get(i));
            } else {
                赌侠.add(list.get(i));
            }
        }
        底牌.add(list.get(51));
        底牌.add(list.get(52));
        底牌.add(list.get(53));
        System.out.println("赌神：" + 赌神);
        System.out.println("赌圣：" + 赌圣);
        System.out.println("赌侠：" + 赌侠);
        System.out.println("底牌：" + 底牌);

        lookPoker(pokers, 赌神, "赌神：");
        lookPoker(pokers, 赌神, "赌圣：");
        lookPoker(pokers, 赌神, "赌侠：");
        lookPoker(pokers, 赌神, "底牌·：");


    }

    public static void lookPoker(HashMap<Integer, String> poker, TreeSet<Integer> 赌神, String s) {
        System.out.println(s);
        for (Integer i : 赌神) {
            System.out.print(poker.get(i) + "\t");
        }
        System.out.println();
        System.out.println("========================");
    }
}
